<?php
declare (strict_types = 1);

namespace app\index\controller;

use app\BaseController;
use think\facade\View;//单例设计模式


class Index extends BaseController
{
    public function index()
    {
        $arr =[
            ['id'=>'1','title'=>'中国女排再次夺冠','content'=>'中国女排再次夺冠...............','type'=>'体育'],
            ['id'=>'2','title'=>'天津大爆炸','content'=>'天津大爆炸...............','type'=>'社会'],
            ['id'=>'3','title'=>'好声音','content'=>'好声音...............','type'=>'娱乐'],
            ['id'=>'4','title'=>'中国股市如过山车','content'=>'中国股市如过山车...............','type'=>'竞技'],
            ['id'=>'5','title'=>'中国女排再次夺冠','content'=>'中国女排再次夺冠...............','type'=>'体育'],
            ['id'=>'6','title'=>'天津大爆炸','content'=>'天津大爆炸...............','type'=>'社会'],
            ['id'=>'7','title'=>'好声音','content'=>'好声音...............','type'=>'娱乐'],
            ['id'=>'8','title'=>'中国股市如过山车','content'=>'中国股市如过山车...............','type'=>'竞技'],

        ];

        View::assign("arr",$arr);
        $name="66";
        View::assign("name",$name);
        $num="6";

        View::assign("num",$num);
        $ov=['name'=>'5'];
        View::assign("ov",$ov);
        $name2="6";
        View::assign("name2",$name2);
        $arrs=['name'=>"nihao",'sex'=>18];
         View::assign("arrs",$arrs);
        return View::fetch("");
    }
}
